package org.su.mamamiya.swagger.context;

import com.sun.tools.javac.tree.JCTree;

/**
 * Created by yangchuan on 2020-02-20 22:09
 */
public class SwaggerContext {


    /**
     * 参数数组
     */
    private  JCTree.JCNewArray apiImplicitParams;

    private  JCTree.JCNewArray apiResponse;

    public JCTree.JCNewArray getApiImplicitParams() {
        return apiImplicitParams;
    }

    public void setApiImplicitParams(JCTree.JCNewArray apiImplicitParams) {
        this.apiImplicitParams = apiImplicitParams;
    }

    public JCTree.JCNewArray getApiResponse() {
        return apiResponse;
    }

    public void setApiResponse(JCTree.JCNewArray apiResponse) {
        this.apiResponse = apiResponse;
    }

    public JCTree.JCNewArray createApiParams(){
        return (JCTree.JCNewArray)apiImplicitParams.clone();
    }

    public JCTree.JCNewArray createApiResponses(){
        return (JCTree.JCNewArray)apiResponse.clone();
    }


    public boolean isNotNull(){
        return apiImplicitParams != null && apiResponse != null;
    }

    public boolean isNotParamsNull(){
        return apiImplicitParams != null;
    }

    public boolean isNotResponsesNull(){
        return apiResponse != null;
    }
}
